<?php

$cryptedPassword = sha1(strtoupper($_POST['login']).':'.strtoupper($_POST['password']));
$login = $_POST['login'];
$mdp = $cryptedPassword;

if($oEnsemble->VerifClient($login,$mdp,$sql))
{
    $oEnsemble->ChargerLeClient($sql, $login, $mdp);
    $oClient = $oEnsemble->getLeClient();

    $oClient->chargerLesCommandes($sql);
   
    $unPanier = new Panier(); 
    $unPanier->ajoutPanier($sql);
    $oClient->ajoutLePanier($unPanier);
    $_SESSION['oClient'] = serialize($oClient);
    
    header('Location: index.php?mod=general&page=accueil');
}
else
{
    header('Location: index.php?mod=GestConnexion&page=connexion');
}

?>
